<template>
  <div class="aside">
    <el-menu  class="sidebar-el-menu"
      :collapse="collapse"
      background-color="#007d65"
      text-color="white"
      active-text-color="#ffffff"
      unique-opened
      style="height:1200px"
      router>
        <template v-for="item in items">
            <el-menu-item :index="item.index" :key="item.index">
              <i :class="item.icon"></i>
              <span slot="title">{{ item.title }}</span>
            </el-menu-item>
      </template>
    <!-- <el-submenu index="1-4">
        <template slot="title">
      <i class="el-icon-location"></i>
      <span slot="title">事务管理</span>
    </template>
      <el-menu-item index="/ask" class="xuan">发起申请</el-menu-item>
      <el-menu-item index="/agenda" class="xuan">待办</el-menu-item>
      <el-menu-item index="/finished" class="xuan">已办</el-menu-item>
    </el-submenu> -->
    </el-menu>
  </div>
</template>

<script>
export default {
  name: 'HomeAside',
  data () {
    return {
      collapse: false,
      items: [
        {
          icon: 'el-icon-s-flag',
          index: 'news',
          title: '新闻'
        },
        {
          icon: 'el-icon-s-data',
          index: 'account',
          title: '账单'
        },
        {
          icon: 'el-icon-user-solid',
          index: 'investment',
          title: '理财计划'
        },
        {
          icon: 'el-icon-document',
          index: 'memo',
          title: '备忘录'
        },
        {
          icon: 'el-icon-document',
          index: 'investment',
          title: '投资理财'
        },
        {
          icon: 'el-icon-document',
          index: 'income',
          title: '收支明细'
        },
        {
          icon: 'el-icon-document',
          index: 'manager',
          title: '用户管理'
        }
      ]
    }
  },
  created () {
    this.$EventBus.$on('collapse', msg => {
      this.collapse = msg
    })
  }
}
</script>

<style scoped>
.sidebar-el-menu:not(.el-menu--collapse) {
  width: 150px;
}
.sidebar-el-menu{
  height: 660px;
}
.xuan{
  padding: 0px;
}
.aside{
  /* overflow: hidden; */
}
</style>
